<script>
    jQuery(function($) {
        document.getElementById('a').onclick = function () {
            var arr = new Array(3);
            arr[0] = "John";
            arr[1] = "Andy";
            arr[2] = "Wendy";

            alert("Original length: " + arr.length);
            arr.length=5;
            alert("New length: " + arr.length)
        }
    });
</script>
<div class="bord">
    <div class="title">length</div>
    <div class="introduce">
        length 属性可设置或返回数组中元素的数目。
    </div>
</div>
<div class="bord">
    <div class="title">演示效果</div>
    <button class="introduce" id="a">打印新的长度</button>
</div>
<div class="bord">
    <div class="title">代码</div>
    <div class="introduce">
        <pre>
                &lt;script&gt;
        jQuery(function($) {
            document.getElementById('a').onclick = function () {
                var arr = new Array(3);
                arr[0] = "John";
                arr[1] = "Andy";
                arr[2] = "Wendy";

                alert("Original length: " + arr.length);
                arr.length=5;
                alert("New length: " + arr.length)
            }
        });
                &lt;/script&gt;
        </pre>
    </div>
</div>